Back to Audio Object
Up to Table of Contents
Ahead to CGI Object

Browser Object

The Browser object lets your applications display a different URL within a Java-enabled Web browser. For some Web browsers, such as Microsoft's Internet Explorer or Netscape Navigator, the object can also display a message in the browser's status bar.

Use the Browser tool to draw a Browser object. The tool appears as follows:

Being able to control the browser could, for example, be used to provide a help system for a Jamba application. You could click on a "help" button that is tied to a Browser object, which would open a new window to display the help information that is stored in an HTML file elsewhere on the Internet. This is an excellent way of accessing files that are not stored locally.

When a Web browser displays an HTML page that references a Java applet, that applet launches. This applet may appear embedded within the HTML page or it may appear in its own window. By default, the browser does not terminate an applet when a different HTML page is displayed. The NewWindow property determines whether or not to launch a new window for the specified URL.

Browser Object Appearance

When you draw a Browser object it appears as shown in the figure below. However, Browser objects are never visible at runtime.

Displaying a Different URL

Typically, a user triggers a Browser object with a Push Button, Picture Push Button, or Graphic object. As an example, you could set up a Browser object with its URL property set to a particular Internet address. You would then set up a button so that its To Do List for a Click event contains an item for the Browser object. The Browser object is directed to display the new information via the GoToURL() method. When the user clicks on the button, the new URL displays. The NewWindow property determines whether or not to launch a new window for the specified URL.

Displaying a Message in the Web Browser Status Bar

The MessageText property allows you to enter a message that will appear in the message bar of your Web Browser when you set the EchoMessage() method. (Note that the MessageText property and EchoMessage() method are not currently supported by all Web browsers.)

Lesson: Displaying a Different URL

In this lesson you create a Browser object that displays a different URL when the user clicks on a button.

Note: This lesson requires that your system has access to a Web browser and that your Internet connection is active. Also, the Browser object does not work in the Jamba Viewer that comes with Jamba. To run this lesson, you need to open the Jamba-generated . html file in your Web Browser.

A completed version of this lesson, called lesn_7, is located in the \Jamba\lessons directory.

Use the Properties tab to set the URL address you want to go to. In this lesson you will use Aimtech's web site.

The NewWindow property, which determines whether a new window appears when the URL displays, is set to True by default.

Now you'll draw the Push Button that instructs the Browser object to launch the URL.

Next you'll change the button so that it says "Aimtech."

Now use the To Do List to set the Browser object to display the Aimtech site when the user clicks on the Push Button.

The default event is Click. Because you want the To Do List action to occur when the user clicks, you'll leave the default as is.

Note that GoToURL() is a method that doesn't require any information in its Value field. You have already specified the URL via the Browser object's URL property.